/*
 *  Copyright (C) 2011 JiangHongTiao <jjurco.sk_gmail.com>
 * 
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 * 
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package sk.lieskove301.jianghongtiao.liaad.prisoner.memory;

import java.util.Deque;
import sk.lieskove301.jianghongtiao.liaad.prisoner.gene.GeneInterface;
import sk.lieskove301.jianghongtiao.liaad.prisoner.strategy.FightResultEnum;

/**
 * <h4>Retrievability (RET)</h4>
 * Retrievability is a number which expresses the ability of a student to recollect a certain fact. We will express it in percents. If we say that a Fact has (in the very moment) RET=70%, it can be interpreted as follows:
 * <ul>
 * <li>There is a 70% probability, that I will recall the Fact.<br>From 100 such Facts, I recollect 70.</li>
 * <li>If I evaluate the testing of Facts on a scale of 0-4 points, I’ll get 3 points. Therefore I’ll make one small mistake or I am not completely positive.</li>
 * <li>Average point evaluation in testing more facts will be 3 points.</li>
 * </ul>
 *
 * <h4>Stability (STAB)</h4>
 * Retrievability decreases over time. In the language of the newly established
 * terms, we say that we are forgetting. The Stability is a parameter which says
 * how quickly the Retrievability disappears. The Stability can be increased by
 * a suitable repetition of the Fact. That is the goal of learning.
 * 
 * <h4>Optimal Forgetting Index (OFI)</h4>
 * How do I remember the Fact? I have to remind myself of it before I forget.
 * Using the implemented definition of RET, one can say: I will remind myself
 * of the fact before its RET drops under a certain level. Let’s call the RET
 * volume we admit to losing the Optimal Forgetting Index (OFI). Knowing the
 * dependency of the RET on time, I can calculate from the appropriate OFI the
 * next time I need to repeat the Fact This is the basic idea for the generalization
 * of the simple advice “review after 1, 2, 4… days”.
 *
 * 
 * @author xjuraj
 */
public interface Forgetting extends GeneInterface{

    /**
     * count agent memories. Based on previous memories count if agent wants to
     * cooperate or if it is better for him to betray. Count also his own memories and
     * decide what he was doing during the game. Agent is counting to remember
     * betray (pessimistic memories)
     * In Memory the last item is always the oldest item. First item is the newest one.
     * @param memory agent memory for previous turns. This memory should be not empty.
     * at least one element have to be there. Every element should have to be in format
     * Deque and have two items of type boolean. (Deque &lt; Boolean, Boolean &gt; )
     * @return Deque with two items of type Boolean - counted memories for agents
     * decisions and objectors decisions
     */
    public FightResultEnum countBetrayMemories(Deque<FightResultEnum> memory);

    /**
     * count agent memories. Based on previous memories count if agent wants to
     * cooperate or if it is better for him to betray. Count also his own memories and
     * decide what he was doing during the game. Agent is counting to remember
     * cooperation (optimistic memories)
     * In Memory the last item is always the oldest item. First item is the newest one.
     * @param memory agent memory for previous turns. This memory should be not empty.
     * at least one element have to be there. Every element should have to be in format
     * Deque and have two items of type boolean. (Deque &lt; Boolean, Boolean &gt; )
     * @return Deque with two items of type Boolean - counted memories for agents
     * decisions and objectors decisions
     */
    public FightResultEnum countCooperateMemories(Deque<FightResultEnum> memory);
}
